package com.gzc.just.play.last.war.centralserver.match.model;

public enum MatchType {
    SOLO(1, "Solo Match"),
    TEAM(2, "Team Match"),
    CUSTOM(3, "Custom Match");
    
    private final int code;
    private final String name;
    
    MatchType(int code, String name) {
        this.code = code;
        this.name = name;
    }
    
    public int getCode() {
        return code;
    }
    
    public String getName() {
        return name;
    }
    
    public static MatchType fromCode(int code) {
        for (MatchType type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        return null;
    }
}
